from torchvision import transforms
from PIL import Image

# 定义图像变换
resize_transform = transforms.Resize(size=(224, 224), interpolation=Image.BICUBIC)

# 打开图像
image = Image.open(r"E:\BL_dataset\舆情数据集\integeated\2098__681_596_495_326\437_839.jpg")

# 应用变换
resized_image = resize_transform(image)

# 显示变换后的图像
print(resized_image.size)
resized_image.show()
